void ssRead()
{
  while (Serial.available() > 0)
  {
    comdata += char(Serial.read());
    delay(2);
    mark = true;
    j = 0;
  }
}
void ssAnalysis(byte datastart, byte datalong)
{
  for (i = 0; i < datalong; i++)
    dataByte[i] = 0;
  for (i = datastart; i < comdata.length(); i++)
  {
    if (comdata[i] == ',')
      j++;
    else
    {
      dataByte[j] = dataByte[j] * 10 + (comdata[i] - '0');
    }
  }
}
void comRead(void)
{
  ssRead();
  if (mark == true)
  {
    if (comdata[0] == 'a')
    {
      ssAnalysis(1, 2);
      v_sub[0] = dataByte[0];
      v_sub[1] = dataByte[1];
      Serial.print("leds  are  ");
      Serial.print(v_sub[0]);
      Serial.print("  ");
      Serial.println(v_sub[1]);
      dacWrite(DAC1, v_sub[0]);
      dacWrite(DAC2, v_sub[1]);
      eepdata[0] =v_sub[0];
      eepdata[1] =v_sub[1];
    }
    else if(comdata[0] == 's')
    {
     EEPROM.write(0, eepdata[0]);
     EEPROM.write(1, eepdata[1]);
     EEPROM.commit();
     Serial.print("leds  saved  ");
     Serial.print(eepdata[0]);
      Serial.print("  ");
      Serial.println(eepdata[1]);
    }
    mark = false;
    comdata = "";
  }
}